//
//  ZBYBaseViewController.swift
//  ZBYBlog
//
//  Created by zby on 16/2/24.
//  Copyright © 2016年 zby. All rights reserved.
//

import UIKit

class ZBYBaseViewController: UITableViewController ,ZBYVistorDelegate{
    
    var visitor: ZBYVistor?
    
    override func viewDidLoad() {
        super.viewDidLoad()

        visitor = ZBYVistor()
        
        visitor?.delegate = self
        
        view = visitor
        
        setUpNav()
   
    }

    //实现代理方法
    func didLogin() {
        
      
    }
    
    func didRegister() {
        let loginVC = ZBYLoginViewController()
        self.presentViewController(UINavigationController(rootViewController: loginVC), animated: true) { () -> Void in
            
        }

    }
    
    //设置Nav
    func setUpNav(){
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action: "didRegister")
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.Plain, target: self, action: "didLogin")
    }
}










